package utils

import (
	"encoding/json"
)

func Struct2Json(v interface{}) []byte {
	b, err := json.Marshal(v)
	if err != nil {
		return nil
	}
	return b
}

func Struct2JsonStr(v interface{}) string {
	b, err := json.Marshal(v)
	if err != nil {
		return "nil"
	}
	return string(b)
}
